﻿<%@ Control Language="C#" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewUserControl<IList<RushTracker.Core.Models.Torrents.Category>>" %>


    <% if (Model.Count > 0 && Model[0].Parent != null)
       {
           Html.ActionLink("Back to " + Model[0].Parent.Name, "ListByCategory", "Torrents", new { categoryId = Model[0].Parent.Id }, "");
       } %>

    <table class="metadata-list">
        <tr>
        <%  int i = 0;
            foreach (Category cat in Model)
            {
                if (i == 3)
                { %>
                    </tr>
                    <tr>
        
                  <% i = 0;
                } %>
        
                        <td><% Html.ActionLink(cat.Name, "ListByCategory", "Torrents", new { categoryId = cat.Id }, ""); %></td>
        
               <% i++;
            } %>
            </tr>
    </table>
